<template>
  <div class="el-div">
    <div class="el-div el-s">
      <el-input
        v-model="input"
        placeholder="请输入任务名称"
        size="mini"
      ></el-input>
    </div>
    <div class="el-div">
      <el-button
        type="primary"
        icon="el-icon-search"
        size="mini"
        @click="search()"
      >搜索
      </el-button
      >
    </div>
    <div class="el-div">
      <el-button @click="cz()" size="mini">重置</el-button>
    </div>
    <el-table :data="jobPlanList.data.list" border size="mini">
      <el-table-column
        prop="id"
        label="报告编号"
        width="80"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="jobName"
        label="任务名称"
        width="300"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="groupTotal"
        label="总测试用例集"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="passTotal"
        label="成功测试用例集"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="failedTotal"
        label="失败测试用例集"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="status"
        label="状态"
        align="center"
        :formatter="getStatus"
      ></el-table-column>
      <el-table-column
        prop="createTime"
        label="创建时间"
        width="300"
        align="center"
        :formatter="formatter"
      ></el-table-column>
      <el-table-column label="操作" align="center" width="260">
        <template slot-scope="scope">
          <el-button size="mini" @click="getDetail(scope.$index, scope.row)"
          >详情
          </el-button
          >
          <el-button
            size="mini"
            type="danger"
            @click="handleDelete(scope.$index, scope.row)"
          >删除
          </el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      layout="total,sizes,prev,pager,next,jumper"
      :page-sizes="[5, 10, 15, 20]"
      :page-size="jobPlanList.data.pageSize"
      :current-page="jobPlanList.data.pageNamber"
      :total="jobPlanList.data.total"
      style="float: right; margin-top: 10px; margin-bottom: 10px"
      :small="true"
    >
    </el-pagination>
  </div>
</template>

<script>
  import index from './index';

  export default index;
</script>

<style scoped>
  @import "index.css";
</style>
